<template>
  <view class="personality-feature">
    <view class="title-img-box">
      <image class="title-img" :src="partTextImgUrl" />
    </view>
    <view class="content-wrapper">
      <view class="content">
        <view class="icon-bar">
          <view
            class="icon-item"
            v-for="(item, index) in dataItem"
            :key="index"
          >
            <image :src="item.url" class="icon"></image>
            <view class="icon-text">{{ item.label }}</view>
            <image :src="path" class="path"></image>
            <view class="desc">
              {{ item.desc.replace(/，/g, '') }}
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    dataItem: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      partTextImgUrl:
        this.$imgBaseSelf + 'career/careerAssessNewImg/03_title.png?v=1',
      path: this.$imgBaseSelf + 'career/careerAssessNewImg/03_path.png'
    };
  },
  mounted() {
    uni
      .createSelectorQuery()
      .in(this)
      .select('.personality-feature')
      .boundingClientRect((rect) => {
        this.$emit('listenRect', rect);
      })
      .exec();
  }
};
</script>

<style lang="scss" scoped>
.personality-feature {
  margin-top: 48rpx;
  position: relative;
  background: url($img-base + 'career/careerAssessNewImg/09_bg.png') no-repeat
    right bottom;
  width: 100%;
  .title-img-box {
    display: flex;
    .title-img {
      height: 112rpx;
      width: 527rpx;
    }
  }

  .content-wrapper {
    margin: -14rpx 32rpx 0 32rpx;
    background: #fff;
    border-radius: 0rpx 20rpx 0rpx 0rpx;
    .content {
      padding: 53rpx 42rpx 42rpx 42rpx;
      background: linear-gradient(0deg, #ffffff 0%, #bbeaf8 100%) no-repeat;
      border-radius: 0rpx 20rpx 0rpx 0rpx;
      border: 1px solid #ffffff;
      background-size: 100% 83rpx;
      .icon-bar {
        display: flex;
        justify-content: space-between;
        .icon-item {
          display: flex;
          flex-direction: column;
          align-items: center;
          .icon {
            width: 123rpx;
            height: 123rpx;
            border-radius: 50%;
            margin-bottom: 26rpx;
          }
          .path {
            width: 28rpx;
            height: 47rpx;
            margin: 25rpx 0 33rpx 0;
          }
          .icon-text {
            font-family: Source Han Sans CN;
            font-weight: 600;
            font-size: 32rpx;
            color: #222222;
          }
          .desc {
            font-family: Source Han Sans CN;
            font-size: 30rpx;
            color: #888888;
            line-height: 48rpx;
            width: 120rpx;
          }
        }
      }
    }
  }
}
</style>
